package main

//对称二叉树
func isSymmetric(root *TreeNode) bool {

	if root == nil {
		return true
	}
	return isSame(root.Left, root.Right)

}

func isSame(l, r *TreeNode) bool {
	if l != nil && r != nil {
		if l.Val == r.Val {
			return isSame(l.Left, r.Right) && isSame(l.Right, r.Left)
		}
	}
	if l == nil && r == nil {
		return true
	}
	return false

}
